#ifndef ELFMEMORYIMAGE_H
#define ELFMEMORYIMAGE_H

#include "crossbit/common.h"
#include "crossbit/MemoryImage.h"

namespace crossbit {

	class ELFMemoryImage: public MemoryImage {
		public:

			ELFMemoryImage(	XTPStr pathname, 
					XTUint32 argc, 
					XTPStr argv[],
					XTPStr envp[] );

			virtual ~ELFMemoryImage();

			// Load the ELF binary image into this Image
			virtual bool load();

			// Map the src address to target address
			virtual XTMemAddr map(XTMemAddr src);

		protected:
			virtual XTMemAddr setupStack(XTMemAddr base);

			static const XTUint32 MAX_ENVIRON = 16384;
	};
}

#endif	//ELFMEMORYIMAGE_H

